//
//  HomeHeaderCollectionReusableView.m
//  huashiedu
//
//  Created by oceans on 2018/8/25.
//  Copyright © 2018年 hema. All rights reserved.
//

#import "HomeHeaderCollectionReusableView.h"

@implementation HomeHeaderCollectionReusableView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self setup];
    }
    return self;
}

- (void)setup {
    
    self.backgroundColor = COLOR(243, 243, 243, 1);
    UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(0, 10, ScreenWidth, 50)];
    backView.backgroundColor = [UIColor whiteColor];
    [self addSubview:backView];
    
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 14, 150, 21)];
    _titleLabel.font = [UIFont boldSystemFontOfSize:17.0];
    [backView addSubview:_titleLabel];
    
    UIButton *more = [UIButton buttonWithType:UIButtonTypeCustom];
    [more setTitle:@"更多 >" forState:UIControlStateNormal];
    [more setTitleColor:COLOR(136, 136, 136, 1) forState:UIControlStateNormal];
    more.titleLabel.font = [UIFont systemFontOfSize:14.0];
    more.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
    more.frame = CGRectMake(ScreenWidth - 20 - 50, 10, 50, 30);
    [more addTarget:self action:@selector(moreButtonPressed) forControlEvents:UIControlEventTouchUpInside];
    [backView addSubview:more];
}

- (void)moreButtonPressed {
    
    [_delegate headerViewMoreButtonPressed:self.tag];
}

@end
